﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Crm.Workflow;
using System.Workflow.Activities;
using System.Workflow.ComponentModel;
using Microsoft.Crm.Sdk;

namespace Infusion.CRM.WF.CRM40WSX.Activity
{

    /// <summary>
    /// This workflow activity (which can be run against any entity) creates a file containing
    /// a barcode image by querying the WebserviceX.Net Barcode Web Service.
    /// </summary>
    [CrmWorkflowActivity("Create Barcode", "WebserviceX.Net")]
    public class CreateBarcodeActivity : SequenceActivity
    {

        #region Workflow Parameters

        /// <summary>
        /// Input parameter: CheckSum.
        /// </summary>
        public static DependencyProperty CheckSumProperty = DependencyProperty.Register("CheckSum", typeof(CrmBoolean), typeof(CreateBarcodeActivity));
        [CrmInput("CheckSum")]
        [CrmDefault("CheckSum")]
        public CrmBoolean CheckSum
        {
            get
            {
                return (CrmBoolean)base.GetValue(CheckSumProperty);
            }
            set
            {
                base.SetValue(CheckSumProperty, value);
            }
        }

        /// <summary>
        /// Input parameter: FontSize.
        /// </summary>
        public static DependencyProperty FontSizeProperty = DependencyProperty.Register("FontSize", typeof(CrmFloat), typeof(CreateBarcodeActivity));
        [CrmInput("FontSize")]
        [CrmDefault("FontSize")]
        public CrmFloat FontSize
        {
            get
            {
                return (CrmFloat)base.GetValue(FontSizeProperty);
            }
            set
            {
                base.SetValue(FontSizeProperty, value);
            }
        }

        /// <summary>
        /// Input parameter: Angle.
        /// </summary>
        public static DependencyProperty AngleProperty = DependencyProperty.Register("Angle", typeof(CrmNumber), typeof(CreateBarcodeActivity));
        [CrmInput("Angle")]
        [CrmDefault("Angle")]
        public CrmNumber Angle
        {
            get
            {
                return (CrmNumber)base.GetValue(AngleProperty);
            }
            set
            {
                base.SetValue(AngleProperty, value);
            }
        }

        /// <summary>
        /// Input parameter: CheckSumMethod.
        /// </summary>
        public static DependencyProperty CheckSumMethodProperty = DependencyProperty.Register("CheckSumMethod", typeof(CrmNumber), typeof(CreateBarcodeActivity));
        [CrmInput("CheckSumMethod")]
        [CrmDefault("CheckSumMethod")]
        public CrmNumber CheckSumMethod
        {
            get
            {
                return (CrmNumber)base.GetValue(CheckSumMethodProperty);
            }
            set
            {
                base.SetValue(CheckSumMethodProperty, value);
            }
        }

        /// <summary>
        /// Input parameter: Height.
        /// </summary>
        public static DependencyProperty HeightProperty = DependencyProperty.Register("Height", typeof(CrmNumber), typeof(CreateBarcodeActivity));
        [CrmInput("Height")]
        [CrmDefault("Height")]
        public CrmNumber Height
        {
            get
            {
                return (CrmNumber)base.GetValue(HeightProperty);
            }
            set
            {
                base.SetValue(HeightProperty, value);
            }
        }

        /// <summary>
        /// Input parameter: ImageFormat.
        /// </summary>
        public static DependencyProperty ImageFormatProperty = DependencyProperty.Register("ImageFormat", typeof(CrmNumber), typeof(CreateBarcodeActivity));
        [CrmInput("ImageFormat")]
        [CrmDefault("ImageFormat")]
        public CrmNumber ImageFormat
        {
            get
            {
                return (CrmNumber)base.GetValue(ImageFormatProperty);
            }
            set
            {
                base.SetValue(ImageFormatProperty, value);
            }
        }

        /// <summary>
        /// Input parameter: LeftOffset.
        /// </summary>
        public static DependencyProperty LeftOffsetProperty = DependencyProperty.Register("LeftOffset", typeof(CrmNumber), typeof(CreateBarcodeActivity));
        [CrmInput("LeftOffset")]
        [CrmDefault("LeftOffset")]
        public CrmNumber LeftOffset
        {
            get
            {
                return (CrmNumber)base.GetValue(LeftOffsetProperty);
            }
            set
            {
                base.SetValue(LeftOffsetProperty, value);
            }
        }

        /// <summary>
        /// Input parameter: Module.
        /// </summary>
        public static DependencyProperty ModuleProperty = DependencyProperty.Register("Module", typeof(CrmNumber), typeof(CreateBarcodeActivity));
        [CrmInput("Module")]
        [CrmDefault("Module")]
        public CrmNumber Module
        {
            get
            {
                return (CrmNumber)base.GetValue(ModuleProperty);
            }
            set
            {
                base.SetValue(ModuleProperty, value);
            }
        }

        /// <summary>
        /// Input parameter: Option.
        /// </summary>
        public static DependencyProperty OptionProperty = DependencyProperty.Register("Option", typeof(CrmNumber), typeof(CreateBarcodeActivity));
        [CrmInput("Option")]
        [CrmDefault("Option")]
        public CrmNumber Option
        {
            get
            {
                return (CrmNumber)base.GetValue(OptionProperty);
            }
            set
            {
                base.SetValue(OptionProperty, value);
            }
        }

        /// <summary>
        /// Input parameter: Ratio.
        /// </summary>
        public static DependencyProperty RatioProperty = DependencyProperty.Register("Ratio", typeof(CrmNumber), typeof(CreateBarcodeActivity));
        [CrmInput("Ratio")]
        [CrmDefault("Ratio")]
        public CrmNumber Ratio
        {
            get
            {
                return (CrmNumber)base.GetValue(RatioProperty);
            }
            set
            {
                base.SetValue(RatioProperty, value);
            }
        }

        /// <summary>
        /// Input parameter: TextPosition.
        /// </summary>
        public static DependencyProperty TextPositionProperty = DependencyProperty.Register("TextPosition", typeof(CrmNumber), typeof(CreateBarcodeActivity));
        [CrmInput("TextPosition")]
        [CrmDefault("TextPosition")]
        public CrmNumber TextPosition
        {
            get
            {
                return (CrmNumber)base.GetValue(TextPositionProperty);
            }
            set
            {
                base.SetValue(TextPositionProperty, value);
            }
        }

        /// <summary>
        /// Input parameter: TopOffset.
        /// </summary>
        public static DependencyProperty TopOffsetProperty = DependencyProperty.Register("TopOffset", typeof(CrmNumber), typeof(CreateBarcodeActivity));
        [CrmInput("TopOffset")]
        [CrmDefault("TopOffset")]
        public CrmNumber TopOffset
        {
            get
            {
                return (CrmNumber)base.GetValue(TopOffsetProperty);
            }
            set
            {
                base.SetValue(TopOffsetProperty, value);
            }
        }

        /// <summary>
        /// Input parameter: Type.
        /// </summary>
        public static DependencyProperty TypeProperty = DependencyProperty.Register("Type", typeof(CrmNumber), typeof(CreateBarcodeActivity));
        [CrmInput("Type")]
        [CrmDefault("Type")]
        public CrmNumber Type
        {
            get
            {
                return (CrmNumber)base.GetValue(TypeProperty);
            }
            set
            {
                base.SetValue(TypeProperty, value);
            }
        }

        /// <summary>
        /// Input parameter: Width.
        /// </summary>
        public static DependencyProperty WidthProperty = DependencyProperty.Register("Width", typeof(CrmNumber), typeof(CreateBarcodeActivity));
        [CrmInput("Width")]
        [CrmDefault("Width")]
        public CrmNumber Width
        {
            get
            {
                return (CrmNumber)base.GetValue(WidthProperty);
            }
            set
            {
                base.SetValue(WidthProperty, value);
            }
        }

        /// <summary>
        /// Input parameter: FileName.
        /// </summary>
        public static DependencyProperty FileNameProperty = DependencyProperty.Register("FileName", typeof(string), typeof(CreateBarcodeActivity));
        [CrmInput("FileName")]
        [CrmDefault("FileName")]
        public string FileName
        {
            get
            {
                return (string)base.GetValue(FileNameProperty);
            }
            set
            {
                base.SetValue(FileNameProperty, value);
            }
        }

        /// <summary>
        /// Input parameter: FilePath.
        /// </summary>
        public static DependencyProperty FilePathProperty = DependencyProperty.Register("FilePath", typeof(string), typeof(CreateBarcodeActivity));
        [CrmInput("FilePath")]
        [CrmDefault("FilePath")]
        public string FilePath
        {
            get
            {
                return (string)base.GetValue(FilePathProperty);
            }
            set
            {
                base.SetValue(FilePathProperty, value);
            }
        }

        /// <summary>
        /// Input parameter: FontName.
        /// </summary>
        public static DependencyProperty FontNameProperty = DependencyProperty.Register("FontName", typeof(string), typeof(CreateBarcodeActivity));
        [CrmInput("FontName")]
        [CrmDefault("FontName")]
        public string FontName
        {
            get
            {
                return (string)base.GetValue(FontNameProperty);
            }
            set
            {
                base.SetValue(FontNameProperty, value);
            }
        }

        /// <summary>
        /// Output Parameter: True if the Email is valid.
        /// </summary>
        public static DependencyProperty IsValidProperty = DependencyProperty.Register("IsValid", typeof(CrmBoolean), typeof(CreateBarcodeActivity));
        [CrmOutput("Is Valid")]
        public CrmBoolean IsValid
        {
            get
            {
                return (CrmBoolean)base.GetValue(IsValidProperty);
            }
            set
            {
                base.SetValue(IsValidProperty, value);
            }
        }

        /// <summary>
        /// Output Parameter: True if operation was successful. If False, Error Message will be populated.
        /// </summary>
        public static DependencyProperty OperationSuccessfulProperty = DependencyProperty.Register("OperationSuccessful", typeof(CrmBoolean), typeof(CreateBarcodeActivity));
        [CrmOutput("Operation Successful")]
        public CrmBoolean OperationSuccessful
        {
            get
            {
                return (CrmBoolean)base.GetValue(OperationSuccessfulProperty);
            }
            set
            {
                base.SetValue(OperationSuccessfulProperty, value);
            }
        }

        /// <summary>
        /// Output Parameter: Error Message is only populated when Operation Successful == false.
        /// </summary>
        public static DependencyProperty ErrorMsgProperty = DependencyProperty.Register("ErrorMsg", typeof(string), typeof(ValidateEmailActivity));
        [CrmOutput("Error Message")]
        public string ErrorMsg
        {
            get
            {
                return (string)base.GetValue(ErrorMsgProperty);
            }
            set
            {
                base.SetValue(ErrorMsgProperty, value);
            }
        }

        #endregion

    }
}
